package com.rd.student.dashuju.sunwenzhuo.kaoshi;

import java.io.FileWriter;
import java.io.Writer;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) throws Exception {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入学生信息(姓名 语文成绩 数学成绩)：");

        Writer writer = new FileWriter("Student.txt");
        writer.write("姓名 语文成绩 数学成绩 总分" + "\n");

        for (int i = 0; i < 3; i++) {
            String message = scanner.nextLine();
            String[] message1 = message.split(" ");

            Integer integer1 = new Integer(message1[1]);
            Integer integer2 = new Integer(message1[2]);
            int num1 = integer1;
            int num2 = integer2;
            int allScore = num1 + num2;
            writer.write(message + " " + allScore + "\n");
        }
        writer.close();
    }
}